package com.helloworld.apps.account.event.spring;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

/**
 * 实现spring自带的事件
 * ContextRefreshedEvent, ContextStartedEvent, RequestHandledEvent etc.
 */
public class ContextRefreshedListener implements ApplicationListener<ContextRefreshedEvent> {
    /**
     * 初始化刷新容器时会发送这个事件，多播器执行
     * org.springframework.context.support.AbstractApplicationContext#finishRefresh()
     */
    @Override
    public void onApplicationEvent(ContextRefreshedEvent cse) {
        System.out.println("Handling context re-freshed event. ");
    }
}
